﻿using Domain.Entity.bs;
using Domain.IRepository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Application.ProductImgService
{
    public class ProductImgService:IProductImgService
    {
        private readonly IProductImgRepository productImgRepository;

        public ProductImgService(IProductImgRepository productImgRepository)
        {
            this.productImgRepository = productImgRepository;
        }


        //添加货品图片
        public async Task<int> AddProductImg(int procid, string img)
        {
            return await productImgRepository.AddProductImg(procid, img);
        }


        //根据货品id查询对应图片
        public async Task<List<ProductImg>> GetImgByPId(int procid)
        {
            return await productImgRepository.GetImgByPId(procid);
        }


        //修改货品图片
        public Task<int> UpdateImg(int procid, string img)
        {
            return productImgRepository.UpdateImg(procid,img);
        }
    }
}
